package com.excel.read;

import java.io.File;

import jxl.Sheet;
import jxl.Workbook;


public class GridExcelConfig extends ExcelConfig{
	ExcelTableManager pmbManager = new TableManagerImpl();
	public String tableConfig(String realPath) {
		
		File excel = null;
		
		File toSave = new File(realPath);		
		Workbook w = null;
		try {
			excel = new File(realPath);
			w = Workbook.getWorkbook(excel);
			String names[] = w.getSheetNames();
			Sheet s = w.getSheet(0);			
			this.pmbManager.writeAllTable("", s);
				//columninfobeans
				AllTable allTable = Config.allTable;
				String []tableNames = allTable.getTableNames();
				for(String tameName : tableNames) {
					DBTable table = allTable.get(tameName);
					table.setColumnInfos();
				}
			
				
		} catch (Exception e) {
		
			System.out.println(e);
		} finally {
			w.close();
		}

		//sList = getList(null);
		
		// List orderTableList=runManaInter.findAll();
		// request.getSession().setAttribute("orderTableList", orderTableList);
		// url="admin/pmb_upload";				
		return "pmb";
	}

}
